1. Field of the Invention
The invention relates in general to image processing. More particularly, this invention relates to a method and apparatus for detecting and removing background color from an input image.
2. Description of the Related Art
In the processing of images, the removal of background colors is often desired. First, a uniform background color usually contains unimportant content. In addition, printing a background color can waste printer ink. Thus, it is often desired to detect background color in a document, and remove the background color.
In U.S. Pat. No. 2002/0159080, Feng discloses a method for background adjustment. A background lightness level in an original image is estimated using lead-edge data. Pixels are then converted to a luminance-chrominance color space. Pixels having lightness levels equal to the background lightness level are mapped to a value corresponding to white as background pixels. Chroma values for the background pixels are compared to a threshold and adjusted as needed, either by adjusting the lightness value or by removing the chrominance values. The luminance-chrominance data is then converted to output space. In summary, the method for background adjustment of Feng estimates a background color using lead-edge data and uses that color throughout its routines. The present invention, on the other hand, determines a dominant color by creating histograms indexed by RGB values of the input image. After determining the correct background color, the present invention removes portions of the image corresponding to that color.